package com.l024.meet.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.l024.framework.base.BaseFragment;
import com.l024.meet.R;
import com.l024.meet.ui.NewFriendActivity;

import de.hdodenhof.circleimageview.CircleImageView;

/**
 * 我的Fragment
 */
public class MeFragment extends BaseFragment implements View.OnClickListener {

    private CircleImageView ivMePhoto;
    private TextView tvNickname;
    private TextView tvServerStatus;
    private LinearLayout llMeInfo;
    private LinearLayout llNewFriend;
    private LinearLayout llPrivateSet;
    private LinearLayout llShare;
    private LinearLayout llNotice;
    private LinearLayout llSetting;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_me, null);
        initView(view);
        return view;
    }

    private void initView(View view) {
        ivMePhoto = (CircleImageView) view.findViewById(R.id.iv_me_photo);
        tvNickname = (TextView) view.findViewById(R.id.tv_nickname);
        tvServerStatus = (TextView) view.findViewById(R.id.tv_server_status);
        llMeInfo = (LinearLayout) view.findViewById(R.id.ll_me_info);
        llNewFriend = (LinearLayout) view.findViewById(R.id.ll_new_friend);
        llNewFriend.setOnClickListener(this);
        llPrivateSet = (LinearLayout) view.findViewById(R.id.ll_private_set);
        llShare = (LinearLayout) view.findViewById(R.id.ll_share);
        llNotice = (LinearLayout) view.findViewById(R.id.ll_notice);
        llSetting = (LinearLayout) view.findViewById(R.id.ll_setting);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.ll_new_friend:{
                startActivity(new Intent(getActivity(), NewFriendActivity.class));
                break;
            }
        }
    }
}
